//
//  JCProgressDetailsController.m
//  JiFengDaRen
//
//  Created by shouhan on 2018/3/30.
//  Copyright © 2018年 陈永发. All rights reserved.
//

#import "JCProgressDetailsController.h"
#import "JCProgressCell.h"

@interface JCProgressDetailsController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UITableView * progressTableView;

@property (nonatomic, strong) NSMutableArray * arrTitle;

@end

@implementation JCProgressDetailsController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"还款进度查询";
    
    [self.view addSubview:self.progressTableView];
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.arrTitle.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    JCProgressCell * cell = [JCProgressCell tableViewCellWithTableView:tableView];
    
    cell.index = indexPath.row;
    
    [cell getTitleNameInfo:self.arrTitle Index:indexPath.row];
    
    cell.progressModel = self.model;
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return __I6Height(50);
}
#pragma mark - 补全分隔线左侧缺失
- (void)viewDidLayoutSubviews {
    if ([self.progressTableView respondsToSelector:@selector(setSeparatorInset:)]) {
        [self.progressTableView setSeparatorInset:UIEdgeInsetsZero];
        
    }
    if ([self.progressTableView respondsToSelector:@selector(setLayoutMargins:)])  {
        [self.progressTableView setLayoutMargins:UIEdgeInsetsZero];
    }
}

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
}

#pragma mark - 懒加载
- (UITableView *)progressTableView{
    if (!_progressTableView) {
        
        _progressTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight - KNAVIGATIONBARHEIGHT) style:UITableViewStylePlain];
        _progressTableView.delegate = self;
        _progressTableView.dataSource = self;
        _progressTableView.backgroundColor = [UIColor whiteColor];
    }
    
    return _progressTableView;
}

- (NSMutableArray *)arrTitle{
    if (!_arrTitle) {
        
        _arrTitle = [NSMutableArray arrayWithObjects:@"还款状态",@"订单号",@"创建时间",@"代扣时间",@"代还时间",@"费用",@"费率",@"通道类型",@"代扣金额",@"代付金额",@"银行卡号",@"银行卡发卡行名称",@"银行简码",@"平台代还计划订单号", nil];
    }
    return _arrTitle;
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
